<?php
	$skinurl=$_SERVER["HTTP_REFERER"];
	if (!$skinurl || !$_GET['skin']) {
		echo '<script>history.back();</script>';
	}
	else {
		$skinurl=parse_url($skinurl);
		if (!$skinurl['query']) {
			$backurl=$skinurl['path'];
			setcookie('skin',$_GET['skin']);
		}
		else {
			$backurl=$skinurl['path'].'?'.$skinurl['query'];
			setcookie('skin',$_GET['skin']);
		}
		header("Location:$backurl");
	}
?>